<?php

namespace App\Repository\Models;

use Illuminate\Database\Eloquent\Model;
use Prettus\Repository\Contracts\Transformable;
use Prettus\Repository\Traits\TransformableTrait;
use Zizaco\Entrust\EntrustRole;

/**
 * Class Role.
 *
 * @package namespace App\Repository\Models;
 */
class Role extends EntrustRole implements Transformable
{
    use TransformableTrait;
    

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['name','display_name','description'];
    
    protected $hidden = ['id'];

    protected $appends = ['role_id'];
    
    public function getRoleIdAttribute(){
       return $this->id; 
    }


    public function permissionRole()
    {
        return $this->hasMany(PermissionRole::class,'role_id','id');
    }
}

